package com.situ.day3;

import java.util.Scanner;

import org.junit.Test;

public class OOPDemo {
	@Test
	public void test1() {
		Student student1 = new Student();
		student1.id = 1;
		student1.name = "zhangsan";
		student1.age = 18;
		student1.className = "Java1812";
		student1.study();
		
		Student student2 = new Student();
		student2.id = 2;
		student2.name = "lisi";
		student2.age = 20;
		student2.className = "UI";
		student2.study();
		
		Teacher teacher = new Teacher();
		teacher.id = 34;
		teacher.name = "wangwu";
		teacher.age = 30;
		teacher.teach();
	}
	
	@Test
	public void test11() {
		System.out.println("请输入学生数量：");
		Scanner scanner = new Scanner(System.in);
		int count = scanner.nextInt();
		Student[] students = new Student[count]; 
		for (int i = 0; i < students.length; i++) {
			Student student = new Student();
			System.out.println("请输入学生id：");
			student.id = scanner.nextInt();
			System.out.println("请输入学生姓名：");
			student.name = scanner.next();
			students[i] = student;
		}
		
		for (int i = 0; i < students.length; i++) {
			Student stu = students[i];
			System.out.println(stu.id);
			System.out.println(stu.name);
			System.out.println(stu.age);
			System.out.println(stu.className);
		}
	}
	
	@Test
	public void test555() {
		boolean[] array = new boolean[4];
		for (int i = 0; i < array.length; i++) {
			System.out.println(array[i]);
		}
		Student[] students = new Student[4];
		for (int i = 0; i < students.length; i++) {
			System.out.println(students[i]);
		}
	}
	
	
	
}
